Use PHP Scripts
2014/04/30 |
Configure Apache2 to use PHP scripts.
|
|
[1] | Install PHP. |
root@www:~# apt-get -y install php5 php5-cgi libapache2-mod-php5 php5-common php-pear
|
[2] | Configure Apache2. |
root@www:~# a2enconf php5-cgi.conf Enabling conf php5-cgi. To activate the new configuration, you need to run: service apache2 reload
root@www:~#
vi /etc/php5/apache2/php.ini # line 879: uncomment and add your timezone date.timezone = "Asia/Tokyo"
/etc/init.d/apache2 restart * Restarting web server apache2 ...done. |
[3] | Create a PHP test page and access to it from any clients with web browser. It's OK if following page is shown. |
root@www:~#
vi /var/www/html/index.php <html>
<body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;"> <?php print Date("Y/m/d"); ?> </div> </body> </html> |
![]() |